import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import( '../views/Login.vue')
  },
  {
    path: '/index',
    name: 'Index',
    component: () => import('../views/Index.vue'),
    redirect: '/welcome',
    children: [
      {
        path: '/welcome',
        name: 'Welcome',
        component: () => import('../views/Welcome.vue'),
      },
      {
        path: '/products',
        name: 'Products',
        component: () => import('../views/product/Products.vue')
      },
      {
        path: '/roles',
        name: 'Roles',
        component: () => import('../views/system/Roles.vue')
      },
      {
        path: '/menus',
        name: 'Menus',
        component: () => import('../views/system/Menus.vue')
      },
      {
        path: '/users',
        name: 'Users',
        component: () => import('../views/system/Users.vue')
      },
      {
        path: '/icons',
        name: 'Icons',
        component: () => import('../views/doc/Icons.vue'),
      },
      {
        path: '/outStocks',
        component: () => import('../views/product/OutStocks.vue')
      },
      {
        path: '/OutStocks/publishStocks',
        name: 'OutStocks',
        component: () => import('../views/product/PublishStocks.vue')
      },
      {
        path: '/inStocks',
        component: () => import('../views/product/InStocks.vue'),
      },
      {
        path: '/productCategorys',
        component: () => import('../views/product/ProductCategorys.vue'),
      },
      {
        path: '/attachments',
        component: () => import('../views/doc/Attachments.vue')
      },
      {
        path: '/products',
        component: () => import('../views/product/Products.vue'),
      },
      {
        path: '/stocks',
        component:  () => import('../views/product/stocks.vue')
      },
      {
        path: '/health',
        component: () => import('../views/system/Health.vue')
      },
      {
        path: '/menus',
        component: () => import('../views/menu/Menus.vue')
      },
      , {
        path: '/inStocks/addStocks',
        component: () => import('../views/product/AddStocks.vue')
      },
      {
        path: '/consumers',
        component: () => import('../views/product/Consumers.vue')
      },
      {
        path: '/loginLog',
        component: () => import('../views/log/LoginLog.vue')
      },
      {
        path: '/blog',
        component:  () => import('../views/doc/Blog.vue')
      },
      {
        path: '/suppliers',
        component: () => import('../views/product/Suppliers.vue')
      },
      {
        path: '/logs',
        component: () => import('../views/log/logs.vue')
      },
    ]
  },
  // {
  //   path: '/main',
  //   name: 'Main',
  //   component: () => import('../views/Main.vue'),
  //   children: [
  //     {
  //       path: '/products',
  //       name: 'Products',
  //       component: () => import('../views/product/Products.vue')
  //     },
  //     {
  //       path: '/roles',
  //       name: 'Roles',
  //       component: () => import('../views/system/Roles.vue')
  //     },
  //     {
  //       path: '/menus',
  //       name: 'Menus',
  //       component: () => import('../views/system/Menus.vue')
  //     },
  //     {
  //       path: '/users',
  //       name: 'Users',
  //       component: () => import('../views/system/Users.vue')
  //     }
  //   ]
  // }
]

const router = new VueRouter({
  routes
})

export default router
